package org.testis.webautomationmodule.ui.objects;

import org.testis.logging.AtofLogLevel;
import org.testis.webautomationmodule.ui.UIBehaviorDecorator;


public class UIInformationAlert extends UIBehaviorDecorator
{

    public UIInformationAlert()
    {
    }


    @Override
    protected boolean setBehavior()
    {
        String hasAlerts = getWebAutomationImpl().getEval(
            "selenium.browserbot.hasAlerts();");
        if (hasAlerts.equals("true")) {
            String infoText = getWebAutomationImpl().getAlert();
            putLog(" Alert found :(" + infoText + ")");
            return true;
        }
        else {
            putLog("No Information alert  discovered",
                   AtofLogLevel.ERROR);
            return true;
        }
    }
}

